home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-26 | 2.2 KB | 79 lines | [TEXT/MPS ] |
- ###########
- # Syntax: makeuserarea cheaderfile [cheaderfile]
- ###########
-
- ############################################
- # Make sure there are at least 4 parameters.
- ############################################
- If "{#}" < 3
- Set ∂1 "`GetFileName -m "Choose a C header (.h) file" "{CIncludes}"`"
- If "{1}" == ""
- Echo "### Usage: {0} filename commontrapname resourceid"
- Exit 1
- Else
- Set ∂# 1
- Set ∂3 "`Request -d 128 "Enter Resource id for this mxbm resource:" `"
- Set ∂2 "`Request -d MyDispatch "Enter a Name for the most common A-Trap in this file:"`"
- End
- end
-
- if !(`exists "PostCHeaderFile"`)
- new PostCHeaderFile
- end
-
- if !(`exists "MxbmResources"`)
- new MxbmResources
- end
-
- ############################################
- # Preprocess to prepare for debugit
- ############################################
- c -e "{1}" > "PostCHeaderFile"
-
- ############################################
- # Need to cut out all extra #include files here
- # My current algorithm goes to the bottom of the file
- # and then selects everything from there to the first LINE statement above
- ############################################
- target "PostCHeaderFile"
- find ∞
- find \#line\:∞
-
- ############################################
- ## Cut the header file we want
- ############################################
- cut §
-
- ############################################
- ## Paste in the header file we want
- ############################################
- find •:∞
- paste §
-
- ############################################
- ## Create the mxbm resource
- ############################################
- if ("{3}")
- debugit -i PostCHeaderFile -o MxbmResources -trap {2} -id {3}
- end
-
- ############################################
- ## Rez in the mxbm resource
- ############################################
- if !(`exists "{SystemFolder}Debugger Prefs"`)
- Set DebuggerPrefs "`GetFileName -m "Choose the Debugger Prefs file" "{SystemFolder}"`"
- If "{DebuggerPrefs}" == ""
- Echo "### Usage: {0} Did not find Debugger Prefs file"
- Exit 1
- Else
- rez MxbmResources -a -o {DebuggerPrefs}
- end
- else
- rez MxbmResources -a -o "{SystemFolder}Debugger Prefs"
- end
-
- close "PostCHeaderFile" -n # close without saving
- close "MxbmResources" -n # close without saving
-
- echo "MXBM Created: Job Done!"
-